import { http } from '../utils/http'
interface  loginparams{
  username:string,
  password:string
}
export interface loginData {

  token:string,
  refreshToken: string,
  id: string,
  username: string,
  avatar: string,
  shareInfo: string,
  nickName: string,
  totalTime: number,
  clockinNumbers: number
}

interface tokenData {
  data: loginData,
  message: string,
  code: number
}
export const login = (data:loginparams): Promise<tokenData> => {
  return http.post<tokenData>("login",data)
}